package org.convallaria.system.biz.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 性能配置类
 * 
 * @author convallaria
 * @since 1.0.0
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "convallaria.performance")
public class PerformanceConfig {

    /**
     * 是否启用性能监控
     */
    private boolean enabled = true;

    /**
     * 性能监控采样率 (0.0-1.0)
     */
    private double samplingRate = 0.1;

    /**
     * 慢查询阈值（毫秒）
     */
    private long slowQueryThreshold = 1000;

    /**
     * 慢接口阈值（毫秒）
     */
    private long slowApiThreshold = 500;

    /**
     * 性能数据保留天数
     */
    private int retentionDays = 7;

    /**
     * 是否启用缓存预热
     */
    private boolean cacheWarmupEnabled = true;

    /**
     * 缓存预热延迟（秒）
     */
    private int cacheWarmupDelay = 30;

    /**
     * 是否启用连接池监控
     */
    private boolean connectionPoolMonitoringEnabled = true;

    /**
     * 是否启用JVM监控
     */
    private boolean jvmMonitoringEnabled = true;

    /**
     * 是否启用GC监控
     */
    private boolean gcMonitoringEnabled = true;
}
